package com.linb.pan.server.common.schedule.launcher;

import com.linb.pan.schedule.ScheduleManager;
import com.linb.pan.server.common.task.CleanExpireChunkFileTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Slf4j
//@Component
public class CleanExpireFileChunkTaskLauncher implements CommandLineRunner {

    /**
     * 正常情况下，每天的半夜12点的第1秒执行
     */
    //private final static String CRON = "1 0 0 * * ?";

    /**
     * 为了方便测试，设为每5秒一次
     */
    private final static String CRON = "0/5 * * * * ?";

    @Autowired
    private CleanExpireChunkFileTask task;

    @Autowired
    private ScheduleManager scheduleManager;

    @Override
    public void run(String... args) throws Exception {
//        scheduleManager.startTask(task, CRON);
    }

}
